//
//  setupTableViewCell.m
//  ioschishan
//
//  Created by 千翼网络科技 on 2017/7/14.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "setupTableViewCell.h"

@implementation setupTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:@"identifier"]) {
        
        [self initView];
    }
    return self;
}

#pragma mark ---------------- init -----------------

- (void)initView{
    
    self.backgroundColor = getColor(@"ffffff");
    
    _leftImg = [[UIImageView alloc]init];
    _leftImg.image = [UIImage imageNamed:@"arrow_icon"];
    [self addSubview:_leftImg];
    [_leftImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(18));
        make.right.mas_equalTo(self).with.offset(screenScale(-15));
        
        
    }];
    
    _nameLable = [[UILabel alloc]init];
    _nameLable.text = @"孩子们总是在不经意间感动你";
    _nameLable.numberOfLines = 1;
    _nameLable.textColor = getColor(@"4a4a4a");
    _nameLable.textAlignment = NSTextAlignmentLeft;
    _nameLable.font = get4sFont(13);
    [self addSubview:_nameLable];
    [_nameLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(0);
        make.left.mas_equalTo(self).with.offset(screenScale(15));
        make.bottom.mas_equalTo(self).with.offset(0);
        
    }];
    
    _statusLable = [[UILabel alloc]init];
    _statusLable.text = @"账号与安全";
    _statusLable.hidden = YES;
    _statusLable.textColor = getColor(@"9b9b9b");
    _statusLable.textAlignment = NSTextAlignmentLeft;
    _statusLable.font = get4sFont(12);
    [self addSubview:_statusLable];
    [_statusLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(0);
        make.right.mas_equalTo(_leftImg.mas_left).with.offset(screenScale(-5));
        make.bottom.mas_equalTo(self).with.offset(0);
        
    }];
    
    _switchButton = [[UISwitch alloc] init];
    [_switchButton setOn:YES];
    _switchButton.hidden = YES;
    _switchButton.transform = CGAffineTransformMakeScale(0.75,0.75);
    _switchButton.onTintColor = [UIColor colorWithRed:0.984 green:0.478 blue:0.224 alpha:1.000];
    [self addSubview:_switchButton];
    [_switchButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.mas_centerY);
        make.right.mas_equalTo(_leftImg.mas_left).with.offset(screenScale(-5));
        
        
    }];
    
    _threadView = [[UIView alloc]init];
    _threadView.backgroundColor = getColor(@"f5f5f5");
    [self addSubview:_threadView];
    [_threadView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self).with.offset(0);
        make.left.mas_equalTo(self).with.offset(0);
        make.width.mas_equalTo(scrWidth());
        make.height.mas_equalTo(screenScale(0.5));
    }];
}

@end
